package com.remiss.seckilldemo.controller;


import com.remiss.seckilldemo.pojo.User;
import com.remiss.seckilldemo.service.IOrderService;
import com.remiss.seckilldemo.vo.OrderDetailVO;
import com.remiss.seckilldemo.vo.ResposeBean;
import com.remiss.seckilldemo.vo.ResposeBeanEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author remiss
 * @since 2021-04-03
 */
@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private IOrderService orderService;
    @RequestMapping("/detail")
    @ResponseBody
    public ResposeBean detail(User user,Long orderId){
        if (null == user){
            return ResposeBean.error(ResposeBeanEnum.SESSION_ERROR);
        }
        OrderDetailVO detailVO = orderService.detail(orderId);
        return ResposeBean.success(detailVO);
    }

}
